package com.leetcode.array_matrix;

/**
 * @author Dennis Li
 * @date 2020/7/29 20:18
 */
public class IsToeplitzMatrix_766 {

    public boolean isToeplitzMatrix(int[][] matrix) {
        if (matrix == null || matrix.length == 0) return true;
        int width = matrix[0].length, high = matrix.length;
        for (int i = 1; i < high; i++) {
            for (int j = 1; j < width; j++) {
                if(matrix[i][j] != matrix[i - 1][j - 1]) return false;
            }
        }
        return true;
    }

}
